Page({

  data: {
    list: [],
    page: 1,
    size: 10,
    flag: true,
  },

  onLoad(options) {
    
  },

  onShow(){
    this.setData({
      page: 1,
      size: 10,
      flag: true,
      list:[]
    })
    this.getjblist()
  },

  onReachBottom() {
    this.getjblist()
  },

  getjblist() {
    if (!this.data.flag) {
      return
    }
    this.setData({
      flag: false
    })
    getApp().globalData.posts('/index.php/api/app/user/sorting/ouyoung_api/getjblist', {
      page: this.data.page,
      size: this.data.size
    }).then(res => {
      let data = res.data.data;
      if (data.length > 0) {
        this.setData({
          flag: true,
          page: this.data.page + 1,
          list: this.data.list.concat(data)
        })
      }
    })
  },

  to_fk_xq(e) {
    let id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/my/fk_xq?id=' + id,
    })
  },

  to_fk(){
    wx.navigateTo({
      url: '/pages/my/fk'
    })
  },

})